package com.atguigu.edu.publisher.mapper;

import com.atguigu.edu.publisher.beans.VideoPlaySecBean;
import com.atguigu.edu.publisher.beans.VideoViewerNumsBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Classname VideoPlaySecMapper
 * @Date 2022/11/20 15:20
 * @Created by arun
 */
public interface VideoPlaySecMapper {
    @Select("SELECT chapter_id,play_sec\n" +
            "FROM dws_play_chapter_videoPlaySec_window\n" +
            "WHERE toYYYYMMDD(stt)=#{date}\n" +
            "ORDER BY play_sec DESC\n" +
            "LIMIT 5")
    List<VideoPlaySecBean> selectVideoPlaySec(@Param("date") Integer date);

    @Select("SELECT video_id,nums\n" +
            "FROM dws_play_video_viewerNums_window\n" +
            "WHERE toYYYYMMDD(stt)=#{date}\n" +
            "ORDER BY nums DESC\n" +
            "LIMIT 6")
    List<VideoViewerNumsBean> selectVideoViewerNums(@Param("date") Integer date);
}
